<?php 
$orgAccount = $this->Session->read('org_account');
?>

<form action="<?php echo $this->Html->url(array('action' => 'contribution_types', 'save')); ?>" method ="post" id="contributions-form" class="form form-horizontal">
    <?php
    $flash = $this->Session->flash();

    if ($flash) {
        echo "<div class='alert alert-success'>"
        . "<button class='close' data-dismiss='alert'><i class='fa fa-times'></i></button>"
        . "$flash"
        . "</div>";
    }
    ?>

    <div class="row">
        <div class="col-lg-12">
            <h5 class="text-info font-bold">Contribution Type Definition</h5>
        </div>

        <div class="col-lg-12">
            <div class="form-group">
                <div class="col-lg-5 control-label">
                    Name:
                </div>
                <div class="col-lg-7 controls">
                    <input type="text" id="name" name="ModuleContributionType[name]" required="" class="form-control input-sm input-s" value='<?php echo isset($details['name']) ? $details['name'] : ""; ?>' />
                    <input type="hidden" id="id" name="ModuleContributionType[id]" required="" class="form-control input-sm input-s" value='<?php echo isset($details['id']) ? $details['id'] : ""; ?>' />
                    <input type="hidden" id="organisation_id" name="ModuleContributionType[organisation_id]" required="" class="form-control input-sm input-s" value='<?php echo $organisation_id; ?>' />
                    <input type="hidden" id="active" name="ModuleContributionType[active]" required="" class="form-control input-sm input-s" value='1' />
                </div>
            </div>

            <div class="form-group">
                <div class="col-lg-5 control-label">
                    Description:
                </div>
                <div class="col-lg-7 controls">
                    <input type="text" id="description"  name="ModuleContributionType[description]" class="form-control input-sm input-s-lg" value='<?php echo isset($details['description']) ? $details['description'] : ""; ?>' />
                </div>
            </div>

        </div>
    </div>

    <div class="form-group m-t-lg">
        <div class="col-lg-5 control-label">
            &nbsp;
        </div> 
        <div class="col-lg-7 controls p-sm" id="form_actions_btn">
            <input type="submit" class="btn btn-sm btn-info" value="Save Changes" />
            <input type="button" class="btn btn-sm btn-white" value="Cancel" />
        </div>
        <div class="col-lg-7 controls p-sm" id="form_loader" style="display: none">
            <i class="fa fa-spinner fa fa-spin fa-2x"></i>
            &nbsp; &nbsp;
            Saving Please Wait ...

        </div>
    </div>
</form>